package com.ay.proxy.reflect.undynamic;

/**
 * 不记得实际生产中是否有用到过了
 * @author Ackles
 */
public class UndynamicProxyDemo {
	public static void main(String[] args) {
		Undynamic undynamic = new UndynamicImpl();
		UndynamicProxy proxy = new UndynamicProxy(undynamic);
		proxy.doUndynamic();
	}
}

interface Undynamic {
	void doUndynamic();
}

class UndynamicImpl implements Undynamic {
	@Override
	public void doUndynamic() {
		System.out.println("UndynamicImpl.doUndynamic");
	}
}

class UndynamicProxy implements Undynamic {
	Undynamic undynamic;
	public UndynamicProxy(Undynamic undynamic) {
		this.undynamic = undynamic;
	}
	@Override
	public void doUndynamic() {
		System.out.println("fefore UndynamicImpl.doUndynamic");
		undynamic.doUndynamic();
		System.out.println("after UndynamicImpl.doUndynamic");
	}
}